import { createApp } from 'vue'
import App from '@/App.vue'
// 引入element-plus插件与样式
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
// svg 需要的配置代码
import 'virtual:svg-icons-register'

import '@/styles/index.scss'

import router from './router'
import pinia from './store'
import './router/guard'

const app = createApp(App)

app.use(router)
app.use(pinia)

// 安装element-plus插件
app.use(ElementPlus, {
  locale: zhCn, // element-plus 国际化配置, 默认是英语
})

import globalComps from '@/components'
app.use(globalComps)

//引入自定义指令文件
import { permission } from '@/directive/permission'
permission(app)

app.mount('#app')
